<template>
    <div class="searchResult">
<<<<<<< HEAD
        <public-header></public-header>
        <div>
            <van-tabs v-model="activeName" @click="onClick" sticky animated swipeable>
                <van-tab name='1' title='审批处理'>审批处理</van-tab>
                <van-tab name='2' title='法规管理'>法规管理</van-tab>
                <van-tab name='3' title='管理机构'>管理机构</van-tab>
                <van-tab name='4' title='检测机构'>检测机构</van-tab>
                <van-tab name='5' title='商户管理'>商户管理</van-tab>
                <van-tab name='6' title='标准库管理'>标准库管理</van-tab>
=======
        <div class='closeTop'>
            <van-icon name="cross" style="margin-right:10px" @click="closeSelf"/>
        </div>
        <div>
            <van-tabs title-active-color='#07c160' color='#07c160' v-model="activeName" @click="onClick" sticky animated swipeable>
                <van-tab name='1' title='审核信息'>
                    <div class='ftS'>
                        <van-cell-group class='messageList'>
                            <van-cell 
                                v-for="(item,index) in approved" 
                                :key='index' 
                                :title="item.fname" 
                                @click="toCheck(item)"
                                is-link />
                        </van-cell-group>
                        <div v-if='approved.length ===0'>暂无结果</div>
                    </div>
                </van-tab>
                <van-tab name='2' title='法规管理'>
                    <div class='ftS'>
                        <van-cell-group class='messageList'>
                            <van-cell 
                                v-for="(item,index) in statue" 
                                :key='index' 
                                :title="item.fname" 
                                is-link />
                        </van-cell-group>
                        <div v-if='statue.length ===0'>暂无结果</div>
                    </div>
                </van-tab>
                <van-tab name='3' title='监管指南'>
                    <div class='ftS'>
                        <van-cell-group class='messageList'>
                            <van-cell 
                                v-for="(item,index) in guide" 
                                :key='index' 
                                :title="item.fname" 
                                is-link />
                        </van-cell-group>
                        <div v-if='guide.length ===0'>暂无结果</div>
                    </div>
                </van-tab>
                <van-tab name='4' title='制度管理'>
                    <div class='ftS'>
                        <van-cell-group class='messageList'>
                            <van-cell 
                                v-for="(item,index) in regime" 
                                :key='index' 
                                :title="item.fname" 
                                is-link />
                        </van-cell-group>
                        <div v-if='regime.length ===0'>暂无结果</div>
                    </div>
                </van-tab>
                <van-tab name='5' title='监管机构'>
                    <div class='ftS'>
                         <van-cell-group class='messageList'>
                            <van-cell 
                                v-for="(item,index) in regulator" 
                                :key='index' 
                                :title="item.fname" 
                                is-link />
                        </van-cell-group>
                        <div v-if='regulator.length ===0'>暂无结果</div>
                    </div>
                </van-tab>
                <van-tab name='6' title='商户'>
                    <div class='ftS'>
                        <van-cell-group class='messageList'>
                            <van-cell 
                                v-for="(item,index) in business" 
                                :key='index' 
                                :title="item.fname" 
                                is-link />
                        </van-cell-group>
                        <div v-if='business.length ===0'>暂无结果</div>
                    </div>
                </van-tab>
                <van-tab name='6' title='检测机构'>
                    <div class='ftS'>
                        <van-cell-group class='messageList'>
                            <van-cell 
                                v-for="(item,index) in inspection" 
                                :key='index' 
                                :title="item.fname" 
                                is-link />
                        </van-cell-group>
                        <div v-if='inspection.length ===0'>暂无结果</div>
                    </div>
                </van-tab>
>>>>>>> zcm
            </van-tabs>
        </div>
    </div>
</template>

<script>
<<<<<<< HEAD
import  publicHeader  from '@/components/publicHeader';
import { 
    Tab
    , Tabs 
=======
import {
    searchAll
} from '@/api/gov/searchResult';
import { 
    Tab
    ,Tabs 
    ,Icon
    ,Toast
    ,Cell
    ,CellGroup 
>>>>>>> zcm
} from 'vant';
export default {
    name: 'searchResult',
    components: {
<<<<<<< HEAD
        publicHeader,
        [Tab.name]:Tab,
        [Tabs.name]:Tabs,
    },
    data () {
        return {
            activeName:'1'
        }
    },
    created(){
     
=======
        [Cell.name]: Cell,
        [CellGroup.name]:CellGroup,
        [Toast.name]: Toast,
        [Icon.name]:Icon,
        [Tab.name]:Tab,
        [Tabs.name]:Tabs,
    },
    props: {
        searchvalue: {
            type: String,
            default: ""
        },
        fopenid: {
            type: String,
            default: ""
        }
    },
    data () {
        return {
            activeName:'1',
            // 审核信息
            approved:[],
            // 法规
            statue:[],
            // 指南
            guide:[],
            // 制度
            regime:[],
            // 监管机构
            regulator:[],
            // 商户
            business :[],
            // 检测机构
            inspection:[]
        }
    },
    created(){
        Toast.loading({
            message: '加载中...',
            forbidClick: true,
            loadingType: 'spinner',
            duration:5000
        });
        searchAll({
            searchvalue:this.searchvalue,
            fopenid:this.fopenid
        }).then(res=>{
            console.log(res)
            if(res.isSuccess){
                this.approved = res.map.approved
                // 法规
                this.statue = res.map.statue
                // 指南
                this.guide = res.map.guide
                // 制度
                this.regime = res.map.regime
                // 监管机构
                this.regulator = res.map.regulator
                // 商户
                this.business = res.map.business
                // 检测机构
                this.inspection = res.map.inspection
            }
            // 关闭提示
            Toast.clear()
        })
      
>>>>>>> zcm
    },
    methods:{
        onClick(name, title) {
            console.log(title);
<<<<<<< HEAD
=======
        },
        toCheck(item){
            if(item.ffunctionid  == 'managercrud_register'){
                this.$router.push({
                    path: '/govLogon',
                    query:
                    {
                        fid:item.ffunctionrecordid,
                        ffunctionid:item.ffunctionid,
                        fappstatusid:item.fappstatusid
                    }
                });
            }else if(item.ffunctionid == 'managercrud_register_person'){
                this.$router.push({
                    path: '/normalLogon',
                    query:
                    {
                        fid:item.ffunctionrecordid,
                        ffunctionid:item.ffunctionid,
                        fappstatusid:item.fappstatusid
                    }
                });
            }
        },
        closeSelf(){
            
            this.$emit('closeSelf')
>>>>>>> zcm
        }
    }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style>
<<<<<<< HEAD

=======
.closeTop{
    height:30px;
    width:100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.ftS{
    font-size:14px;
    margin-top:10px;
}
.searchResult .van-tab__text{
    font-size:16px;
}
>>>>>>> zcm
</style>
